package com.galaxy.commom.base.constant;

import com.google.common.collect.Maps;
import java.util.Map;

/**
 * 系统通用常量类
 * @author caijinbang
 * @date 2018/9/7 20:25
 */
public final class SystemConstants {
  /**
   * 当前用户
   */
  public static final String CURRENT_USER = "CURRENT_USER";
  /**
   * 当前用户
   */
  public static final String CURRENT_USER_ID = "CURRENT_USER_ID";

  /**
   * mapper方法中查询语句开头格式，必须以select开头，才会切换数据源
   */
  public static final String MAPPER_METHOD_STARTSWITH_SELECT = "select";

  /**
   * 缓存键值
   */
  public static final Map<Class<?>, String> CACHE_KEY_MAP = Maps.newHashMap();

  /**
   * 缓存命名空间前缀
   */
  public static final String CACHE_NAMESPACE_PREFIX = "galaxy:";


  /**
   * 日志操作类型枚举
   */
  public enum LogOptEnum {
    //查询
    QUERY(0, "查询"),
    ADD(1, "新增"),
    MODIFY(2, "修改"),
    DELETE(3, "删除"),
    LOGIN(4, "登录"),
    UNKNOW(9, "未知");
    private final int value;
    private final String message;

    LogOptEnum(int value, String message) {
      this.value = value;
      this.message = message;
    }

    public int value() {
      return this.value;
    }

    public String getMessage() {
      return this.message;
    }

  }
}
